// cargo 工作空间下的库项目编写集成测试示例
//注指定生成的库类型 crate-type = ["rlib"] 才能运行集成测试，这是rust的默认类型
#[test]
fn test_add() {
    assert_eq!(library_demo::math::add(3, 2), 5);
}

#[test]
fn test_subtract() {
    assert_eq!(library_demo::math::subtract(5, 3), 2);
}

#[test]
fn test_multiply() {
    assert_eq!(library_demo::math::multiply(3, 4), 12);
}

#[test]
fn test_divide() {
    assert_eq!(library_demo::math::divide(10, 2), 5);
}

#[test]
fn test_is_even() {
    assert_eq!(library_demo::utils::is_even(4), true);
    assert_eq!(library_demo::utils::is_even(5), false);
}

#[test]
fn test_is_odd() {
    assert_eq!(library_demo::utils::is_odd(5), true);
    assert_eq!(library_demo::utils::is_odd(4), false);
}
